<?php
class Daotao_AjaxController extends Zendvn_Controller_Action {
		
	protected $_arrParam; //Mang tham so nhan duoc khi mot Action chay
	protected $_currentController; //Duong dan cua Controller
	protected $_actionMain; //Duong dan cua Action chinh
	
	public function init(){
		
		$this->_arrParam = $this->_request->getParams(); //Mang tham so nhan duoc khi mot Action chay
		$this->_currentController = '/' . $this->_arrParam['module'] . '/' . $this->_arrParam['controller']; //Duong dan cua Controller
		$this->_actionMain = '/' . $this->_arrParam['module'] . '/'	. $this->_arrParam['controller'] . '/index'; //Duong dan cua Action chinh
	
		//Truyen ra ngoai view
		$this->view->arrParam = $this->_arrParam;
		$this->view->currentController = $this->_currentController;
		$this->view->actionMain = $this->_actionMain;
	
		$this->view->siteConfig = Zend_Registry::get('siteConfig');
		$template_path = TEMPLATE_PATH . "/public/" . $this->view->siteConfig['template']['site'];
		$this->loadTemplate($template_path, 'template.ini', 'user');
		
		$language = Zend_Registry::get('language');
		$this->view->language = $language['language'];
	}
	
	public function loadKhoahocAction() {
		$tblLophoc = new Daotao_Model_Lophoc();
		$this->view->slbLophoc = $tblLophoc->itemInSelectbox($this->_arrParam, array('task' => 'get-lophoc'));
		$this->_helper->layout->disableLayout();
	}
		
	public function loadLophocAction() {
		$tblLophoc = new Daotao_Model_Lophoc();
		$this->view->Item = $tblLophoc->getItem($this->_arrParam, array('task'=>'admin-edit-load-hd'));
		$this->_helper->layout->disableLayout();
	}
}
